
package requests

import (
	"github.com/goravel/framework/contracts/http"
	"github.com/goravel/framework/contracts/validation"
)

type ArticleRequest struct {

	Cid string `json:"cid" form:"cid"`

	Title string `json:"title" form:"title"`

	Author string `json:"author" form:"author"`

	ImageInput string `json:"image_input" form:"image_input"`

	Synopsis string `json:"synopsis" form:"synopsis"`

	ShareTitle string `json:"share_title" form:"share_title"`

	ShareSynopsis string `json:"share_synopsis" form:"share_synopsis"`

	Visit string `json:"visit" form:"visit"`

	Sort string `json:"sort" form:"sort"`

	Url string `json:"url" form:"url"`

	Status string `json:"status" form:"status"`

	AddTime string `json:"add_time" form:"add_time"`

	Hide string `json:"hide" form:"hide"`

	AdminId string `json:"admin_id" form:"admin_id"`

	MerId string `json:"mer_id" form:"mer_id"`

	ProductId string `json:"product_id" form:"product_id"`

	IsHot string `json:"is_hot" form:"is_hot"`

	IsBanner string `json:"is_banner" form:"is_banner"`

}

func (r *ArticleRequest) Authorize(ctx http.Context) error {
	return nil
}

func (r *ArticleRequest) Rules(ctx http.Context) map[string]string {
	return map[string]string{

		"cid": "required",

		"title": "required",

		"author": "required",

		"image_input": "required",

		"synopsis": "required",

		"share_title": "required",

		"share_synopsis": "required",

		"visit": "required",

		"sort": "required",

		"url": "required",

		"status": "required",

		"add_time": "required",

		"hide": "required",

		"admin_id": "required",

		"mer_id": "required",

		"product_id": "required",

		"is_hot": "required",

		"is_banner": "required",

	}
}

func (r *ArticleRequest) Messages(ctx http.Context) map[string]string {
	return map[string]string{}
}

func (r *ArticleRequest) Attributes(ctx http.Context) map[string]string {
	return map[string]string{}
}

func (r *ArticleRequest) PrepareForValidation(ctx http.Context, data validation.Data) error {
	return nil
}
